xen/arm: do not use is_running to decide whether we can write directly to the LR...
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 19 Apr 2013 17:24:03 +0000 (18:24 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 22 Apr 2013 11:34:10 +0000 (12:34 +0100)
commit071c61e7367987a9f71dc18c3c58a5dba659a5c8
tree8452deeb0799f5a87f7074932b145f923d2fdfd1
parentb09ea2a57899624ba8da6b2efdf1901cda847616
xen/arm: do not use is_running to decide whether we can write directly to the LR registers

During context switch is_running is set for the next vcpu before the
gic state is actually saved.
This leads to possible nasty races when interrupts need to be injected
after is_running is set to the next vcpu but before the currently
running gic state has been saved from the previous vcpu.

Use current instead of is_running to check which one is the currently
running vcpu: set_current is called right before __context_switch and
schedule_tail with interrupt disabled.

Re-enabled interrupts after ctxt_switch_from, so that all the context
switch saving functions don't have to worry about receiving interrupts
while saving state.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/domain.c
xen/arch/arm/gic.c